package com.solidumgame.martillo.interfaces.gameOver
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class GameOverUI extends Sprite
	{	
		private var btnPlayAgain:btnVolverAJugar;
		
		public function GameOverUI(stage:Stage)
		{
			super();
			btnPlayAgain = new btnVolverAJugar();
			btnPlayAgain.addEventListener(MouseEvent.CLICK, Play);
			addChild(btnPlayAgain);
			btnPlayAgain.x=250;
			btnPlayAgain.y=250;
		}
		
		public function Play(e:Event):void
		{	
			this.removeChild(btnPlayAgain);
			btnPlayAgain.removeEventListener(MouseEvent.CLICK,Play);
			this.dispatchEvent(new Event("startGame"));
		}
	}
}